-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Update SDK to bring in RSG one assembly changes #30827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e8e97c7
to
21d3307
Compare
Closing in favor of merging this into #30891. |
872e461
to
e5e3473
Compare
e5e3473
to
4986a10
Compare
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> | ||
<NoWarn>RS0016</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build for this codepath relies on the RazorPageDocumentClassifier
which we didn't update to support consolidated views. As a result, the types generated in the output assembly are still public and picked up by the public API analyzer during the build.
I fixed this in this PR but we'll need to wait for the aspnetcore -> SDK -> installer flow with this change to finish before we can remove this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I would block on that, but it's good that we picked it up quickly
*REMOVED*Microsoft.AspNetCore.Mvc.Razor.Extensions.MvcViewDocumentClassifierPass.MvcViewDocumentClassifierPass() -> void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, since we're doing this in multiple classes now I think using a constructor that takes a flag will be better than duplicating the code to avoid ragrets later.
@@ -0,0 +1,4 @@ | |||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn expects there to be a lock file even it if is empty. Commiting this to avoid the annoyance of always having this as an untracked file.
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> | ||
<NoWarn>RS0016</NoWarn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I would block on that, but it's good that we picked it up quickly
@@ -31,14 +31,8 @@ public WebAuthenticationTests(WebApplicationFactory<Startup> fixture) | |||
public static TheoryData<string> NotAddedEndpoints => | |||
new TheoryData<string>() | |||
{ | |||
"/AzureAD/Account/AccessDenied", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, previously, the Azure AD UI projects used a NullApplicationFactory and instead relied on their own logic to discover the application parts from the related assembly (see https://github.com/dotnet/aspnetcore/pull/31039/files#diff-754ffcfbe4655cc4cca0a446a4f1b0eb3552a8795c136385b6ffad03259e0a7dL199). This API gets invoked from the AddAzureAD
extension method.
Since the views are compiled into the app assembly and we are no longer using the NullApplicationFactory
, we don't need to rely on the discovery logic (I removed it in the new PR above).
The controllers don't change though because those are discovered with a feature provider that exists outside of the views story.
@@ -47,7 +47,7 @@ public static IdentityBuilder AddDefaultUI(this IdentityBuilder builder) | |||
private static readonly IDictionary<UIFramework, string> _assemblyMap = | |||
new Dictionary<UIFramework, string>() | |||
{ | |||
[UIFramework.Bootstrap4] = "Microsoft.AspNetCore.Identity.UI.Views.V4", | |||
[UIFramework.Bootstrap4] = "Microsoft.AspNetCore.Identity.UI.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this goes away. This used to switch the related part but we're not generating any now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. You're right. I should've looked way closer at this. I made the appropriate changes in #31039.
.GetRelatedAssemblies(GetType().Assembly, throwOnError: true) | ||
.SingleOrDefault(); | ||
foreach (var part in CompiledRazorAssemblyApplicationPartFactory.GetDefaultApplicationParts(relatedAssenbly)) | ||
foreach (var part in CompiledRazorAssemblyApplicationPartFactory.GetDefaultApplicationParts(Assembly.GetExecutingAssembly())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the consolidated part factory already take care of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does. However, this particularly startup logic removes all the discovered application parts and adds its own.
.ConfigureApplicationPartManager(manager => manager.ApplicationParts.Clear()) |
I think it does this to validate the behavior of the specific extension methods used here.
builder.Features.Add(new RazorPageDocumentClassifierPass(useConsolidatedMvcViews: true)); | ||
builder.Features.Add(new MvcViewDocumentClassifierPass(useConsolidatedMvcViews: true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builder.Features.Add(new RazorPageDocumentClassifierPass(useConsolidatedMvcViews: true)); | |
builder.Features.Add(new MvcViewDocumentClassifierPass(useConsolidatedMvcViews: true)); | |
builder.Features.Add(new RazorPageDocumentClassifierPass(builder.Configuration.UseConsolidatedMvcViews)); | |
builder.Features.Add(new MvcViewDocumentClassifierPass(builder.Configuration.UseConsolidatedMvcViews)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need the if
@@ -0,0 +1,4 @@ | |||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BrennanConroy why do you do this to us?
No description provided.